<?php
/**
 * Created by PhpStorm.
 * User: 小蛮哼哼哼
 * Email: 243194993@qq.com
 * Date: 2022/1/17
 * Time: 16:36
 * motto: 现在的努力是为了小时候吹过的牛逼！
 */

declare(strict_types=1);

namespace app\api\controller;

use app\common\lib\Show;
use app\common\lib\Status;
use app\api\model\mysql\MallVideo;
use think\facade\Log;

class Video extends Base
{
    public function getListInfo()
    {
        $page = $this->request->param('page', 1, 'intval');
        $limit = $this->request->param('limit', 10, 'intval');
        try {
            $lists = (new MallVideo())->getIndexListPage([], 'id,title,image,video', $limit);
        } catch (\Exception $e) {
            Log::error("video-getListInfo:" . $e->getMessage() . " " . " " . $e->getFile() . " " . $e->getLine());
            return Show::json_show(Status::mini_error, "内部发生错误");
        }
        return Show::json_show(Status::mini_normal, "ok", $lists);
    }
}